package com.scs.application.modules.dept.mapper;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.scs.application.core.mapper.IBaseMapper;
import com.scs.application.modules.base.entity.Dept;
import com.scs.application.modules.dept.dto.ApplyAutoOnWayDTO;
import com.scs.application.modules.dept.entity.ApplyAuto;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 */
public interface ApplyAutoMapper extends IBaseMapper<ApplyAuto> {

    /**
     * PDA 查询所有待响应的 数据
     */
    List<ApplyAuto> listApplyAutoPDA(ApplyAuto applyAuto);

    List<Dept> autoApplyDeptList(@Param(Constants.WRAPPER) QueryWrapper<Dept> wrapper);

    List<Dept> autoTransferDeptList(@Param(Constants.WRAPPER) QueryWrapper<Dept> wrapper);

    IPage<?> pageForTransfer(IPage page, @Param(Constants.WRAPPER) QueryWrapper<ApplyAuto> wrapper, @Param("params") Map<String, Object> params);

    List<ApplyAutoOnWayDTO> listApplyAutoOnWay(@Param(Constants.WRAPPER) QueryWrapper<ApplyAutoOnWayDTO> wrapper);

    void reSetApplyAuto(List<String> ids);

    List<String> canFillQty(@Param(Constants.WRAPPER) QueryWrapper<ApplyAuto> wrapper,@Param("warehouseId") String warehouseId);

    List<ApplyAuto> simpleList(@Param(Constants.WRAPPER) QueryWrapper<ApplyAuto> wrapper);

    List<ApplyAuto> listWithHistory(@Param(Constants.WRAPPER) QueryWrapper<ApplyAuto> wrapper);

    Double getSumAmount(@Param("startDate") String startDate, @Param("endDate") String endDate);
}
